﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Library
{
    public class Task : IComparable
    {
        public double id { get; set; }
        public string uuid { get; set; }
        public double user_id { get; set; }
        public string title { get; set; }
        public int importance { get; set; }
        public double due { get; set; }
        public bool has_due_time { get; set; }
        public double completed_at { get; set; }
        public double created_at { get; set; }
        public double updated_at { get; set; }
        public bool repeat { get; set; }
        public string privacy { get; set; }
        public bool read_only { get; set; }
        public User user { get; set; }
        public Creator creator { get; set; }
        public string notes { get; set; }
        public int comment_count { get; set; }
        public Tags tags { get; set; }

        public int CompareTo(object obj)
        {
            Task task = (Task)obj;

            if (this.id < task.id)
            {
                return -1;
            }
            else if (this.id == task.id)
            {
                return 0;
            }
            else
            {
                return 1;
            }
        }

        public Task()
        {
            user = new User();
            creator = new Creator();
            tags = new Tags();
        }
    }
}
